from abc import ABC, abstractmethod
from typing import List

from fastapi import Depends

from forward.api.admin.schemas.article import ArticleListOutSchema
from forward.api.admin.schemas.decorate import DecorateDataArticleInSchema
from forward.api.admin.service.article.article import  ArticleService
from forward.model.tables.decorate import DecoratePageModel




class DecorateArticleService():
    

    async def data_article(self, article_in: DecorateDataArticleInSchema) -> List[ArticleListOutSchema]:
        return await self.article_service.list_limit(article_in.limit)

    @classmethod
    def __init__(self, article_service: ArticleService):
        self.article_service: ArticleService = article_service

    @classmethod
    async def instance(cls, article_service: ArticleService = Depends(ArticleService.instance)):
        """实例化"""
        return cls(article_service)
